#include "DataServer.h"

void DataServer :: start() {
    listenForRequest();
    while(isServingData) {
        if(isRequestPending()) {
            sendResponse();
            listenForRequest();
        }
    }
}

bool DataServer :: isRequestPending() {
    int flag;
    MPI_Test(&request, &flag, &status);
    return flag;
}
